home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / dragonball-kart.swf / scripts / frame_21 / PlaceObject2_372_1026 / CLIPACTIONRECORD onClipEvent(load).as
Encoding:
Text File  |  2011-10-17  |  10.3 KB  |  338 lines

  1. onClipEvent(load){
  2.    _root.bgm.stop();
  3.    _root.bgm.attachSound("mus1");
  4.    _root.bgm.start();
  5.    stop();
  6.    zol = 1;
  7.    while(zol <= 4)
  8.    {
  9.       _root["org" + zol].kar.gotoAndStop(_root.boil[zol]);
  10.       _root["org" + zol].codenum2 = _root.boil[zol];
  11.       _root["org" + zol].codenum = zol;
  12.       zol++;
  13.    }
  14.    i = 1;
  15.    while(i <= 7)
  16.    {
  17.       _root["br" + i]._visible = 0;
  18.       i++;
  19.    }
  20.    i = 1;
  21.    while(i <= _root.nowball)
  22.    {
  23.       _root["br" + i]._visible = 1;
  24.       i++;
  25.    }
  26.    _root.uis.gotoAndStop(_root.nowchar);
  27.    _root.noj = 1;
  28.    _root.juara = [0,0,0,0,0];
  29.    _root.xxx = 30;
  30.    _root.yyy = 30;
  31.    _root.bonus = 0;
  32.    _root.bonus1 = 0;
  33.    _root.bonus2 = 0;
  34.    _root.bonus3 = 0;
  35.    _root.bonus4 = 0;
  36.    _root.boost = 0;
  37.    _root.jumplit = 0;
  38.    _root.kame = 1;
  39.    _root.mspeed = 0;
  40.    _root.tim = 0;
  41.    _root.maxbns = [0,15,17,17,20,20,1];
  42.    _root.tottai = 0;
  43.    _root.fastfood = 180;
  44.    i = 2;
  45.    while(i <= 4)
  46.    {
  47.       _root["org" + i].ambil = 0;
  48.       _root["org" + i].pauss = 0;
  49.       _root["org" + i].b1 = 0;
  50.       _root["org" + i].b2 = 0;
  51.       _root["org" + i].b4 = 0;
  52.       _root["org" + i].bns1 = 0;
  53.       _root["org" + i].bns2 = 0;
  54.       _root["org" + i].bns4 = 0;
  55.       _root["org" + i].speed = 10;
  56.       _root["org" + i].jumping = false;
  57.       _root["org" + i].gravity = 10;
  58.       _root["org" + i].jumpspeed = 19;
  59.       _root["org" + i].js = _root["org" + i].jumpspeed;
  60.       _root["org" + i].ssp = 10;
  61.       _root["org" + i].boost = 0;
  62.       _root["org" + i].kena = 0;
  63.       _root["org" + i].k = 0;
  64.       _root["org" + i].kame = 1;
  65.       _root["org" + i].divr = 0;
  66.       _root["org" + i].bonusan = 0;
  67.       _root["org" + i].bonus = 0;
  68.       _root["org" + i].jumplit = 0;
  69.       _root["org" + i].shields = 0;
  70.       _root["org" + i].fini = 0;
  71.       _root["org" + i].kamecharge = 0;
  72.       _root["org" + i].onEnterFrame = function()
  73.       {
  74.          with(this)
  75.          {
  76.             if(fini == 1)
  77.             {
  78.                _x += 10;
  79.                _y = 243;
  80.             }
  81.          }
  82.          if(this.pauss != 1)
  83.          {
  84.             with(this)
  85.             {
  86.                if(tari.hitTest(_root.gor.fin) and fini != 1)
  87.                {
  88.                   _root.juara[_root.noj] = codenum2;
  89.                   _root.noj = _root.noj + 1;
  90.                   fini = 1;
  91.                   gravity = 10;
  92.                   pauss = 1;
  93.                   _y = 243;
  94.                }
  95.                if(kame == 1)
  96.                {
  97.                   kamecharge++;
  98.                   if(kamecharge >= 60)
  99.                   {
  100.                      kame = 0;
  101.                      kamecharge = 0;
  102.                   }
  103.                }
  104.                if(bns1 == 1)
  105.                {
  106.                   b1++;
  107.                   if(b1 >= 60)
  108.                   {
  109.                      boost = 0;
  110.                      bns1 = 0;
  111.                      b1 = 0;
  112.                      kar.char.gotoAndStop(1);
  113.                   }
  114.                }
  115.                if(bns2 == 1)
  116.                {
  117.                   b2++;
  118.                   if(b2 >= 120)
  119.                   {
  120.                      shields = 0;
  121.                      bns2 = 0;
  122.                      b2 = 0;
  123.                      shil.removeMovieClip();
  124.                   }
  125.                }
  126.                if(bns3 == 1 and jumping != true)
  127.                {
  128.                   _root.tottai = _root.tottai + 1;
  129.                   _root.attachMovie("tai","tai" + _root.tottai,100 + _root.tottai);
  130.                   _root["tai" + _root.tottai]._x = _x - 15;
  131.                   _root["tai" + _root.tottai]._y = _y + 15;
  132.                   _root["tai" + _root.tottai].onEnterFrame = function()
  133.                   {
  134.                      if(_root.org1.spon != 0)
  135.                      {
  136.                         this._x -= _root.org1.spon;
  137.                      }
  138.                      i = 1;
  139.                      while(i <= 4)
  140.                      {
  141.                         if(this.hitTest(_root["org" + i]) and i != codenum)
  142.                         {
  143.                            if(_root["org" + i].shields != 1)
  144.                            {
  145.                               _root["org" + i].ssp = 0;
  146.                               _root["org" + i].kena = 1;
  147.                               _root["org" + i].k = 0;
  148.                               _root["org" + i].kar.char.gotoAndStop(3);
  149.                               this.removeMovieClip();
  150.                               break;
  151.                            }
  152.                            this.removeMovieClip();
  153.                         }
  154.                         i++;
  155.                      }
  156.                   };
  157.                   bns3 = 0;
  158.                }
  159.                if(_root.org1._x - _x >= _root.fastfood)
  160.                {
  161.                   divr = 7;
  162.                }
  163.                else if(_root.org1._x - 30 - _x <= 0)
  164.                {
  165.                   divr = 0;
  166.                }
  167.                kam = random(30) + 1;
  168.                if(kam == 1 and kame != 1 and jumping != true and _root.allstop != 1)
  169.                {
  170.                   this.kar.char.gotoAndStop(4);
  171.                   kameh = 1;
  172.                   kame = 1;
  173.                }
  174.                if(kena == 1)
  175.                {
  176.                   k++;
  177.                   if(k >= 24)
  178.                   {
  179.                      boost = 0;
  180.                      divr = 0;
  181.                      k = 0;
  182.                      kena = 0;
  183.                      ssp = 10 + divr + boost;
  184.                      kar.char.gotoAndStop(1);
  185.                   }
  186.                }
  187.                if(!_root.gor.hitTest(_x + 30 - 1,_y,true))
  188.                {
  189.                }
  190.                if(_root.gor.hitTest(_x,_y - 89,true) and kena != 1)
  191.                {
  192.                   if(jumping != true)
  193.                   {
  194.                      jumping = true;
  195.                   }
  196.                }
  197.                if(!_root.gor.hitTest(_x + 33,_y,true))
  198.                {
  199.                   uy = _root.org1.spon;
  200.                   if(_root.org1.ssp <= 0)
  201.                   {
  202.                      uy = 0;
  203.                   }
  204.                   if(_root.org1.kenal == 1)
  205.                   {
  206.                      _x += ssp + divr + boost;
  207.                   }
  208.                   else
  209.                   {
  210.                      if(_root.org1.kena2 == 1)
  211.                      {
  212.                         cd = ssp + divr + boost;
  213.                      }
  214.                      else
  215.                      {
  216.                         cd = ssp + divr + boost - uy;
  217.                      }
  218.                      _x += cd;
  219.                   }
  220.                }
  221.                else
  222.                {
  223.                   jumping = true;
  224.                }
  225.                if(!_root.gor.hitTest(_x,_y + 30,true) && jumping == false)
  226.                {
  227.                   _y += gravity;
  228.                   gravity += 1;
  229.                   if(_root.gor.hitTest(_x + 31,_y,true))
  230.                   {
  231.                      _x -= 10;
  232.                   }
  233.                }
  234.                if(jumping == true)
  235.                {
  236.                   _y -= jumpspeed;
  237.                   jumpspeed -= 2;
  238.                   if(_root.gor.hitTest(_x + 29,_y,true))
  239.                   {
  240.                      _x -= 15;
  241.                   }
  242.                }
  243.                if(_root.gor.hitTest(_x,_y + 29,true))
  244.                {
  245.                   gravity = 10;
  246.                   jumping = false;
  247.                   jumpspeed = js;
  248.                }
  249.                if(_root.gor.hitTest(_x,_y + 29,true))
  250.                {
  251.                   if(_y >= 240)
  252.                   {
  253.                      _y = 240;
  254.                   }
  255.                   else if(_y >= 210)
  256.                   {
  257.                      _y = 210;
  258.                   }
  259.                   else if(_y >= 180)
  260.                   {
  261.                      _y = 180;
  262.                   }
  263.                   else if(_y >= 150)
  264.                   {
  265.                      _y = 150;
  266.                   }
  267.                   else if(_y >= 120)
  268.                   {
  269.                      _y = 120;
  270.                   }
  271.                   else if(_y >= 90)
  272.                   {
  273.                      _y = 90;
  274.                   }
  275.                   else if(_y >= 60)
  276.                   {
  277.                      _y = 60;
  278.                   }
  279.                   _y += 3;
  280.                }
  281.                if(ambil == 1)
  282.                {
  283.                   am++;
  284.                   if(am >= 12)
  285.                   {
  286.                      ambil = 0;
  287.                   }
  288.                }
  289.                if(_root.gor.hitTest(_x,_y - 30 + 15,true))
  290.                {
  291.                   i = 1;
  292.                   while(i <= _root.maxbns[_root.stage])
  293.                   {
  294.                      if(tar.hitTest(_root.gor["bns" + i]) and _root.gor["bns" + i].dead != 1 and ambil != 1)
  295.                      {
  296.                         if(_root.gor["bns" + i].pol != 1)
  297.                         {
  298.                            ambil = 1;
  299.                            bonus = random(4) + 1;
  300.                            _root.gor["bns" + i].pol = 1;
  301.                            _root.gor["bns" + i].dead = 1;
  302.                            _root.gor["bns" + i].gotoAndStop(2);
  303.                            bonusan = bonus;
  304.                            switch(bonus)
  305.                            {
  306.                               case 1:
  307.                                  boost = 5;
  308.                                  bns1 = 1;
  309.                                  kar.char.gotoAndStop(2);
  310.                                  break;
  311.                               case 2:
  312.                                  bns2 = 1;
  313.                                  shields = 1;
  314.                                  attachMovie("shil" + codenum2,"shil",3);
  315.                                  break;
  316.                               case 3:
  317.                                  bns3 = 1;
  318.                                  break;
  319.                               case 4:
  320.                                  bns3 = 1;
  321.                            }
  322.                            break;
  323.                         }
  324.                      }
  325.                      i++;
  326.                   }
  327.                   _y += 5;
  328.                   jumpspeed = -1;
  329.                }
  330.             }
  331.          }
  332.       };
  333.       i++;
  334.    }
  335.    _root.gor._x = 0;
  336.    stop();
  337. }
  338.